package mdm.led.dao;

import org.springframework.stereotype.Repository;

import mdm.led.entity.Permission;
import mdm.led.entity.Role;
import mdm.led.entity.RolePermission;

import java.util.List;

@Repository
public interface RoleMapper {
    
    Role getByRoleId(int roleid);
    
    List<Role> selectByCondition(Role role);
    
    List<RolePermission> selectByRoleIdList(int roleid);
    
    List<Permission> selectByPermission();   //权限列表
    
    int insertSelective(Role role);
    
    int insertRolePermissionSelective(RolePermission rolep);
    
    void updateRole(Role role);
    
    void deleteByRolePermission(RolePermission rolepermission);
    
    /**
     * 根据名称查询角色
     * @param name
     * @return
     */
    Role selectByName(Role role);
    
    List<Permission> findPermitionByRole(Role role);
    
    void deleteByRolePermissionId(int roleid);
}